﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BTM_Client_Application
{
    /// <summary>
    /// Логика взаимодействия для ButtonWithImage.xaml
    /// </summary>
    public partial class ButtonWithImage : UserControl
    {
        private readonly ButContent _content;

        public ButtonWithImage()
        {
            InitializeComponent();
            _content = new ButContent();
            ContentPanel.DataContext = _content;
        }

        public ButtonWithImage(ImageSource imSource, String text, RoutedEventHandler onClick, Orientation orientation = Orientation.Vertical)
            : this()
        {
            _content.ButtonImageSource = imSource;
            _content.ButtonText = text;
            _content.PanelOrientation = orientation;
            But.Click += onClick;

        }

        class ButContent
        {
            public Orientation PanelOrientation { get; set; }
            public String ButtonText { get; set; }
            public ImageSource ButtonImageSource { get; set; }
        }
    }
}
